package com.nacos.provider.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/provider/config")
@RefreshScope
public class ConfigController {

    @Value("${isNewBusi}")
    private boolean isNewBusi;

    @Value("${name}")
    private String name;

    @Value("${common}")
    private String common;

    @Value("${common-base}")
    private String commonBase;

    @SentinelResource(value = "get")
    @RequestMapping("/get")
    public String get() {
        String backInfo ="name:"+name+"  isNewBusi:"+isNewBusi +" common:"+common+" commonBase:"+commonBase;
        System.out.println("========"+backInfo);
        return backInfo;
    }
}